<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>招标目录管理（配送企业端）</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">

    <section class="content-header">
            <h1>招标目录管理</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active">药品招标管理</li>
            <li class="active">采购项目管理</li>
            <li class="active">招标目录管理</li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                     <div class="form-group form-group-xs">
                        <label>项目名称：</label>
                        <select class="form-control" style="width:220px;" id="projId" name="projId"></select>
                    </div>
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div class=" box box-warning bottongroup"></div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
 <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/psBidCatalog/getDataList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit: true,
                height: 270,
                colNames: ['品规数','projId', '项目名称','采购开始日期','采购结束日期' ],
                colModel: [
					{ name: 'drugCount', width: 60, align: 'center' ,sortable: false,formatter: function (val, opts, rowdata) {return "<a href=\"${ctx}/psBidCatalog/toHaveAddDrugQualityList.html?projId="+rowdata.projId+ "&name="+rowdata.name+"\">"+val+"</a>";}},
                    { name: 'projId', key:true,hidden:true,width: 40, align: 'center' ,sortable: false},
                    { name: 'name', width: 130, align: 'left' ,sortable: false},
                    { name: 'starttime', width: 100, align: 'center' ,sortable: false},
                    { name: 'endtime', width: 100, align: 'center' ,sortable: false}
					
                ],
                rowNum: 0,
                rownumbers: true,
                viewrecords: true,
                caption: "采购项目列表",
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                	 formatSelect("#projId",data.rows);
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        //查询
        function gridSerch() {
        	var projId = $("#projId").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        		"projId":projId
    	        		}
    	    }).trigger("reloadGrid"); //重新载入  
    	}
    </script>
</body>
</html>